package game;

import java.util.Arrays;
import java.util.List;

import edu.monash.fit2099.engine.Actor;
import edu.monash.fit2099.engine.Display;
import edu.monash.fit2099.engine.FancyGroundFactory;
import edu.monash.fit2099.engine.GameMap;
import edu.monash.fit2099.engine.World;
import game.entity.actor.Player;
import game.entity.actor.Stegosaur;
import game.entity.ground.*;
import game.entity.item.Fruit;
import game.entity.actor.VendingMachine;

/**
 * The main class for the Jurassic World game.
 */
public class Application {


    public static void main(String[] args) {
        World world = new World(new Display());

        FancyGroundFactory groundFactory = new FancyGroundFactory(new Dirt(), new Wall(), new Floor(), new Tree(),new Bush());

        List<String> map = Arrays.asList(
                "................................................................................",
                "................................................................................",
                ".....#######....................................................................",
                ".....#_____#....................................................................",
                ".....#_____#....................................................................",
                ".....###.###....................................................................",
                "...................o............................................................",
                "..................o...................+++.......................................",
                ".................o.....................++++.....................................",
                "................o..................+++++........................................",
                "...............o.....................++++++.....................................",
                "....oooooooooooooooooo................+++.......................................",
                "....oooooooooooooooo.................+++........................................",
                "................................................................................",
                "............+++.................................................................",
                ".............+++++..............................................................",
                "...............++........................................+++++..................",
                ".............+++....................................++++++++....................",
                "............+++.......................................+++.......................",
                "................................................................................",
                ".........................................................................++.....",
                "........................................................................++.++...",
                ".........................................................................++++...",
                "..........................................................................++....",
                "................................................................................");
        GameMap gameMap = new GameMap(groundFactory, map);
        world.addGameMap(gameMap);

        Actor player = new Player("Player", '@', 100);
        world.addPlayer(player, gameMap.at(9, 4));
        gameMap.at(15,3).addItem(new Fruit("fruit2"));
        gameMap.at(7,4).addActor(new VendingMachine());

        // Place a pair of stegosaurs in the middle of the map
        // gameMap.at(35, 3).addActor(new Stegosaur("Stegosaur","male",100));
        // gameMap.at(30, 4).addActor(new Stegosaur("Stegosaur","female",100));

        gameMap.at(9, 3).addActor(new Stegosaur("Stegosaur","male",100));

        // gameMap.at(48, 5).addActor(new Brachiosaur("Brachiosaur","female",80));
        // gameMap.at(8, 7).addActor(new Brachiosaur("Brachiosaur","female",130));


        world.run();


    }
}
